<h3><?php echo link_to2(__('compose message'), 'compose_msg', array('plate' => $sf_params->get('q'))); ?></h3>

<h4><?php echo __('messages'); ?></h4>
<ul>
<?php foreach ($plates as $plate => $messages): ?>
  <li>
    <?php echo link_to2($plate, 'list_by_plate', array('id' => $plate)); ?>
    <?php echo link_to2(__('compose message'), 'compose_msg', array('plate' => $plate)); ?>
    <ul>
  <?php foreach ($messages as $message): ?>
    <?php include_partial('board/message', array('message' => $message, 'hidePlateLink' => true, 'limitComments' => 5)); ?>
  <?php endforeach; ?>
    </ul>
  </li>
<?php endforeach; ?>
</ul>

<h4><?php echo __('profiles'); ?></h4>
<ul>
<?php foreach ($profiles as $profile): ?>
  <li>
    <?php echo link_to2($profile, 'list_by_driver', array('id' => $profile->url_name)); ?>
    <?php if ($profile->plate): ?>
      <?php echo link_to2(__('compose message'), 'compose_msg', array('plate' => $profile->plate)); ?>
    <?php endif; ?>
  </li>
<?php endforeach; ?>
</ul>
